"""
定义和使用圆类

Version: 0.1
Author: yuwl
Date：2024-3-25
"""

import math

class Circle(object):
    
    def __init__(self, radius):
        self._radius = radius

    # 像访问属性一样访问方法
    @property
    def radius(self):
        return self._radius
    
    @radius.setter
    def radius(self, radius):
        self._radius = radius if radius > 0 else 0

    @property
    def perimeter(self):
        return 2 * math.pi * self._radius
    
    @property
    def area(self):
        return math.pi * self._radius * self._radius

if __name__ == '__main__':
    radius = float(input('请输入游泳池的半径：'))
    small = Circle(radius)
    big = Circle(radius + 3)
    print('围墙的造价为：¥%.1f元' % (big.perimeter * 115))
    print('过道的造价为：¥%.1f元' % ((big.area - small.area) * 65))